export const readFile = (filePath: string) => {
  
  return new Promise((resolve, error) => {
    // 创建一个新的xhr对象
    let xhr = null
    if (window.XMLHttpRequest) {
      xhr = new XMLHttpRequest()
    }
    xhr!.open('GET', filePath, false)
    xhr?.setRequestHeader('Cache-Control', 'no-store, no-cache, must-revalidate')
    xhr?.setRequestHeader('Pragma', 'no-cache ')
    xhr?.setRequestHeader('Expires', '0')
    xhr!.overrideMimeType('text/html;charset=utf-8')
    xhr!.send(null)
    resolve(xhr!.responseText)
  })
}
